//切换活动的商品
$('a[name="activity"]').click(function(){
	
	var productType = $(this).attr("data-productType");
	var activityName = $(this).text();
	var json = {
			"productType":productType,
			"activityName":activityName,
			"searchType":""
	}
	var jsonStr = JSON.stringify(json);
	window.location.href = base_url + "customer/getPlatformActivityClassify?jsonStr="+jsonStr;
});

/**
 * 点击综合
 */
/*$("#zonghe").click(function(){
	var productType = $("#productTypeMessage").attr("data-productType");
	//不等于抢购
	if(productType!=2){
		var jsonStr = $("#jsonStr").val();
		var jsonObject = JSON.parse(jsonStr);
		jsonObject.searchType = "";
		jsonStr = JSON.stringify(jsonObject);
		window.location.href = base_url + "customer/getPlatformActivityClassify?jsonStr="+jsonStr;
	}
});

*/
/**
 * 点击销量
 */
$("#salesVolume").click(function(){
	var productType = $("#productTypeMessage").attr("data-productType");
	//不等于抢购
	if(productType!=2){
		var jsonStr = $("#jsonStr").val();
		var jsonObject = JSON.parse(jsonStr);
		jsonObject.searchType = "3";
		jsonStr = JSON.stringify(jsonObject);
		window.location.href = base_url + "customer/getPlatformActivityClassify?jsonStr="+jsonStr;
	}
});

/**
 * 点击价格
 */
$("#priceChoose").click(function(){
	var productType = $("#productTypeMessage").attr("data-productType");
	//不等于抢购
	if(productType!=2){
		var jsonStr = $("#jsonStr").val();
		var jsonObject = JSON.parse(jsonStr);
		var i =$(this).find('i');
		if(i.length>0){
			if(i.hasClass("up active")){
				jsonObject.searchType = "2";
			}else if(i.hasClass("down active")){
				jsonObject.searchType = "1";
			}else{
				jsonObject.searchType = "1";
			}
		}else{
			jsonObject.searchType = "2";
		}
		jsonStr = JSON.stringify(jsonObject);
		window.location.href = base_url + "customer/getPlatformActivityClassify?jsonStr="+jsonStr;
	}
});

//进入商品详情
$(".product").click(function(){
	var productId = $(this).attr("data-productId");
	var productType = $(this).attr("data-productType");
	var json = {
		"productId":productId	
	}
	var jsonStr = JSON.stringify(json);
	if(productType=="lingshou"){
		window.location.href = base_url + "customer/getProductDetail?jsonStr="+jsonStr;
	}else if(productType=="pintuan"){
		window.location.href = base_url + "customer/getShopGroupProductDetailMsg?jsonStr="+jsonStr;
	}else if(productType=="zhekou"){
		window.location.href = base_url + "customer/getDiscountProductDetail?jsonStr="+jsonStr;
	}else if(productType=="zhongchou"){
		window.location.href = base_url + "customer/getCrowdFundingProductDetail?jsonStr="+jsonStr;
	}else if(productType=="miaosha"){
		window.location.href = base_url + "customer/getRushProductDetail?jsonStr="+jsonStr;
	}
	
});